package com.kefu.call.vo;

import javax.validation.constraints.Size;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import com.kefu.call.model.CallSipuser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "SIP用户")
public class CallSipuserUpdateVo extends AbstractUpdateVo<CallSipuser,Long> {

    @NotNull
    @ApiModelProperty(value = "主键")
    private String oid;
//    @ApiModelProperty(value = "账号")
//    private String sipUser;
    
    @ApiModelProperty(value = "密码")
    private String password;
    
    @ApiModelProperty(value = "公司id")
    private String company;

    
    @ApiModelProperty(value = "虚拟密码",hidden = true)
    private String vmPassword;
    
    @ApiModelProperty(value = "允许",hidden = true)
    private String tollAllow;
    
    @ApiModelProperty(value = "账户代码",hidden = true)
    private String accountcode;
    
    @ApiModelProperty(value = "用户联系地址",hidden = true)
    private String userContext;
    
    @ApiModelProperty(value = "有效的呼叫者号码",hidden = true)
    private String effectiveCallerIdName;
    
    @ApiModelProperty(value = "有效的呼叫者号码",hidden = true)
    private String effectiveCallerIdNumber;
    
    @ApiModelProperty(value = "出站呼叫者姓名",hidden = true)
    private String outboundCallerIdName;
    
    @ApiModelProperty(value = "呼出号码",hidden = true)
    private String outboundCallerIdNumber;
    
    @ApiModelProperty(value = "呼叫组",hidden = true)
    private String callgroup;
    @ApiModelProperty(value = "呼叫组ID",hidden = true)
    private Integer callgroupid;
    
    @ApiModelProperty(value = "组名",hidden = true)
    private String groupname;
    @ApiModelProperty(value = "是否开启留言",hidden = true)
    private Integer voicemail;
    @ApiModelProperty(value = "是否bypass模式",hidden = true)
    private Integer bypass;
    @ApiModelProperty(value = "是否需要录音",hidden = true)
    private Integer needrecord;
    
    @ApiModelProperty(value = "规则",hidden = true)
    private String dialplanName;
    @ApiModelProperty(value = "是否开启转接",hidden = true)
    private Integer transferenable;
    
    @ApiModelProperty(value = "转接模式[all:全部转接 busy:遇忙转接 noAnswer:没有应答转接 offLine:不在线转接]",hidden = true)
    private String transfermodel;
    
    @ApiModelProperty(value = "转接的方式,默认走【n.lua】流程",hidden = true)
    private String transfercontent;
    @ApiModelProperty(value = "是否开启nat重写IP和端口",hidden = true)
    private Integer sipForceContact;


    @Override
    public CallSipuser convert() {
        CallSipuser info = new CallSipuser();
        info.setPassword(password);
        info.setVmPassword(vmPassword);
        info.setTollAllow(tollAllow);
        info.setAccountcode(accountcode);
        info.setUserContext(userContext);
        info.setEffectiveCallerIdName(effectiveCallerIdName);
        info.setEffectiveCallerIdNumber(effectiveCallerIdNumber);
        info.setOutboundCallerIdName(outboundCallerIdName);
        info.setOutboundCallerIdNumber(outboundCallerIdNumber);
        info.setCallgroup(callgroup);
        info.setCallgroupid(callgroupid);
        info.setGroupname(groupname);
        info.setVoicemail(voicemail);
        info.setBypass(bypass);
        info.setNeedrecord(needrecord);
        info.setDialplanName(dialplanName);
        info.setTransferenable(transferenable);
        info.setTransfermodel(transfermodel);
        info.setTransfercontent(transfercontent);
        info.setSipForceContact(sipForceContact);
        info.setCompany(company);
        KefuContext context = KefuContext.getKefuContext();
        info.setOid(oid);
        return info;
	}
}